<extend name='Public/_Main' />
<block name='right'>
<div class='table-responsive'>
    <table class="table table-hover">
        <thead>
            <tr>
                <th>ID</th>
                <th>用户</th>
               
                <th>最后登录日期</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <foreach name='list.user' item='list'>
                <tr>
                    <td>
                        {$list.id}
                    </td>
                    <td>
                        {$list.username}
                    </td>
                    
                    <td>
                        {$list.logintime|friendlyDate}
                    </td>
                    <td>
                        <a class="btn btn-default" href="{:U('lock',array('id'=>$list['id']))}">
                            <switch name="list.lock">
                                <case value="1"><span class='glyphicon glyphicon-remove'></span></case>
                                <case value="0"><span class='glyphicon glyphicon-ok'></span></case>
                                <default />default
                            </switch>
                        </a>
                    </td>
                    <td>
                        <div role="group" class="btn-group">
                            <a href="{:U('romUser',array('id'=>$list['id']))}" class="btn btn-default">编辑</a>
                            <a href="{:U('DelUser',array('id'=>$list['id']))}" class="btn btn-danger getajax">删除</a></div>
                    </td>
                </tr>
            </foreach>
        </tbody>
    </table>
    </div>
    <!-- Modal -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title" id="myModalLabel">新增用户</h4>
                </div>
                <div class="modal-body">
                    <form class="require" action="{:U('addUser')}" method="post">
                        <div class="form-group">
                            <label for="exampleInputEmail1">所属角色<span class="Validform_checktip"></span></label>
                            <select name="group_id" class='form-control selectpicker' data-live-search="true" datatype='*'>
                                <foreach name="group" item="v" class='form-control' datatype='*'>
                                    <option value="{$v['id']}" {$v[ 'selected']}>
                                        {$v.title}
                                    </option>
                                </foreach>
                            </select>
                        </div>
                        <div class="form-group">
                            <label for="exampleInputEmail1">姓名/用户名(不可修改)<span class="Validform_checktip"></span></label>
                            <input type="text" class="form-control" placeholder="用户名" datatype='*' nullmsg='请填写用户名' errormsg='格式错误' name="username">
                        </div>
                        <div class="form-group">
                            <label for="exampleInputEmail1">密码<span class="Validform_checktip"></span></label>
                            <input type="password" class="form-control" placeholder="" datatype='*' nullmsg='请填写密码' errormsg='格式错误' name="password">
                        </div>
                        <div class="form-group">
                            <label for="exampleInputEmail1">邮箱<span class="Validform_checktip"></span></label>
                            <input type="text" class="form-control" placeholder="邮箱" datatype='e' nullmsg='请填写邮箱' errormsg='格式错误' name="email">
                        </div>
                       
                        <input type='hidden' name='id' value='{$list.userinfo.0.id}' />
                        <div class='col-xs-6'>
                            <button class="btn btn-lg btn-primary btn-block" type="submit">保存</button>
                        </div>
                        <div class='col-xs-6'>
                            <button class="btn btn-lg btn-default btn-block" type="button" data-dismiss="modal">关闭</button>
                        </div>
                    </form>
                    <br/>
                    <br/>
                    <br/>
                </div>
            </div>
        </div>
    </div>
    <!--end Modal-->
</block>
